package types

type Page struct {
	Items     interface{}
	PageSize  int
	PageCount int
	Total     int
	PageIndex int
}

func NewPage(items interface{}, total int, ps, pi int) Page {
	pc := total / ps
	if ps*pc != total {
		pc++
	}
	return Page{
		Items:     items,
		PageSize:  ps,
		PageCount: pc,
		Total:     total,
		PageIndex: pi,
	}
}
